﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Text;
using System.Xml.Linq;
using System.Xml;

namespace CommonFunction
{
    public class AccessData
    {
        public XmlDocument GetData()
        {
            XmlDocument xmlDoc = new XmlDocument();

            xmlDoc.Load(Common.DataFilePath);

            return xmlDoc;
        }

        public bool SaveData(XmlDocument data)
        {
            try
            {
                data.Save(Common.DataFilePath);

                return true;
            }
            catch
            {
                return false;
            }
        }

        public XmlDocument GetData_Facebook()
        {
            XmlDocument xmlDoc = new XmlDocument();

            xmlDoc.Load(FB_Common.DataFilePath);

            return xmlDoc;
        }

        public bool SaveData_Facebook(XmlDocument data)
        {
            try
            {
                data.Save(FB_Common.DataFilePath);

                return true;
            }
            catch
            {
                return false;
            }
        }

        public XmlDocument GetData_Pokerist()
        {
            XmlDocument xmlDoc = new XmlDocument();

            xmlDoc.Load(Pokerist_Common.Data_FilePath);

            return xmlDoc;
        }

        public bool SaveData_Pokerist(XmlDocument data)
        {
            try
            {
                data.Save(Pokerist_Common.Data_FilePath);

                return true;
            }
            catch
            {
                return false;
            }
        }

        public XmlDocument GetData_Pokerist_BS()
        {
            XmlDocument xmlDoc = new XmlDocument();

            xmlDoc.Load(Pokerist_BS_Common.Data_FilePath);

            return xmlDoc;
        }

        public bool SaveData_Pokerist_BS(XmlDocument data)
        {
            try
            {
                data.Save(Pokerist_BS_Common.Data_FilePath);

                return true;
            }
            catch
            {
                return false;
            }
        }

        public XmlDocument GetData_5D()
        {
            XmlDocument xmlDoc = new XmlDocument();

            xmlDoc.Load(Common.DataFilePath);

            return xmlDoc;
        }
    }
}
